package com.wnxy.controller;


import com.wnxy.annotation.Validate;
import com.wnxy.dto.Result;
import com.wnxy.dto.RoomDto;
import com.wnxy.dto.StatusCode;
import com.wnxy.service.RoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author alice
 * @since 2021-10-25
 */
@RestController
@RequestMapping("/room")
public class RoomController {
    @Autowired
   private RoomService roomService;
//    @Validate
    @GetMapping("/roomList")
    public Result getRoomList(){
        List<RoomDto> dto=roomService.getRoomList();
        return Result.getInstance().setFlag(true)
                .setStatusCode(StatusCode.SUCCESS.getCode())
                .setMessage("查询成功").setData(dto);
    }

}

